package v1

import (
	"github.com/gogf/gf/v2/frame/g"
	"tFilm4/internal/model"
)

type SignUpReq struct {
	g.Meta   `path:"/user/signUp" method:"post" tags:"UserService" summary:"注册一个新账号"`
	Username string `v:"required#请输入用户名|min-length:1" dc:"用户名"`
	Password string `v:"required#请输入密码|length:6,16" dc:"密码"`
	Email    string `v:"required#请输入邮箱|email" dc:"邮箱"`
}
type SignUpRes struct{}

type SignInReq struct {
	g.Meta   `path:"/user/signIn" method:"post" tags:"UserService" summary:"登录"`
	Username string `v:"required#请输入用户名|min-length:1" dc:"用户名"`
	Password string `v:"required#请输入密码|length:6,16" dc:"密码"`
}
type SignInRes struct {
	UserInfo *model.UserInfo `json:"userInfo" dc:"用户信息"`
}

type CheckUsernameReq struct {
	g.Meta   `path:"/user/checkUsername" method:"post" tags:"UserService" summary:"检查用户名可用性（是否存在）"`
	Username string `dc:"用户名"`
}
type CheckUsernameRes struct{}

type QueryUserByIdReq struct {
	g.Meta `path:"/user/queryUserById" method:"post" tags:"UserService" summary:"根据Id查询用户"`
	Id     string `v:"required#请输入Id" dc:"用户Id"`
}
type QueryUserByIdRes struct {
	UserInfo *model.UserInfo `json:"userInfo" dc:"用户信息"`
}

type GetUserListReq struct {
	g.Meta    `path:"/user/list" method:"post" tags:"UserService" summary:"获取用户列表"`
	PageSize  int `v:"required#请输入页大小|integer"`
	PageNum   int `v:"required#请输入页号|integer"`
	SearchKey string
}
type GetUserListRes struct {
	UserInfos []model.UserInfo `json:"list" dc:"用户列表"`
	UserCount int              `json:"count" dc:"总条数"`
}

type UpdateUserReq struct {
	g.Meta   `path:"/user/update" method:"post" tags:"UserService" summary:"修改用户"`
	UserId   int64
	Username string
	//RealName string
	//Qq string
	//Email string
	//Wechat string
	//Phone string
}
type UpdateUserRes struct {
}
